import java.util.Arrays;
import java.util.Scanner;
class Solution {
    public int[] twoSum(int[] nums, int target) {
        int[] arr = new int [2];
        int count = nums.length;
        for(int i = 0;i<count-1;i++){
            for(int j = 1;j < count;j++){
                if(nums[i] + nums[j] == target && i!=j){
                    arr[0] = i;
                    arr[1] = j;
                }
            }
        }
        return arr;
    }
}
public class Text {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int len = 0;
        int target = 0;
        int[] brr = new int[2];
        System.out.println("请输入目标值:");
        target = sc.nextInt();
        System.out.println("请输入这个数组的长度");
        len = sc.nextInt();
        int[] num = new int[len];
        System.out.println("请输入整形数组");
        for(int i = 0;i < len;i++){
            num[i] = sc.nextInt();
        }
        Solution sol = new Solution();
        brr = sol.twoSum(num,target);
        System.out.println("下标为:");
        System.out.println(Arrays.toString(brr));
    }
}
